#!/usr/bin/env python

import base64, dns.message

datalist= list()

#Get data
for i in [1,2,3,4,5,6,7]:
        with open ("/media/data/Dropbox/school/RP2.2/ripeatlas/code/facebook/chunk"+str(i), "r") as myfile:
            jsondata=myfile.read().replace('\n', '')
        #JSON to python object
        (true,false,null) = (True,False,None)
        result = eval(jsondata)

        for entry in result:
            #if entry.get("result"): print dns.message.from_wire(base64.b64decode(entry.get("result").get("abuf")))
            if entry.get("result"): datalist.append(str(dns.message.from_wire(base64.b64decode(entry.get("result").get("abuf")))))
            #print "\n\n"
    

print datalist


